﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Private/Privada.master" AutoEventWireup="true" CodeBehind="index.aspx.cs" Inherits="HRP.Private.Utilizadores.index" %>
<%@ Import Namespace ="HRP.Utilidades" %>
<asp:Content ID="Content1" ContentPlaceHolderID="PrivadaMainContent" runat="server">
    <div class="box-info full">
        <h2><strong>Utilizadores</strong></h2>
        <%if (utilizadoresTable.Items.Count == 0)
          { %>
        <h5>Não tem utilizadores registados.
        </h5>
        <%}
          else
          { %>

        <asp:Repeater runat="server" ID="utilizadoresTable">
            <HeaderTemplate>
                <div class="table-responsive">
                    <table data-sortable class="table table-hover table-striped">
                        <thead>
                            <tr>
                                <th style="width: 30px" data-sortable="false">
                                    <input type="checkbox" class="rows-check"></th>
                                <th>Nome</th>
                                <th>UserName</th>
                                <th>Data de Criação</th>

                                <th>Activo</th>
                                <th data-sortable="false">Opção</th>
                            </tr>
                        </thead>
                        <tbody>
            </HeaderTemplate>
            <ItemTemplate>
                <tr>
                    <td>
                        <input type="checkbox" class="rows-check"></td>
                    <td><%#Eval("Name") %></td>
                    <td><%#Eval("username") %></td>
                    <td><%#((DateTime)Eval("createDate")).ToString(DefinicoesSite.DataFormato) %></td>

                    <td><span class="label <%#(bool)Eval("active") ? "label-success" : "label-danger"%> "><%#(bool)Eval("active") ? "Sim" : "Não"%></span></td>
                    <td>
                        <div class="btn-group btn-group-xs">
                            <asp:LinkButton ID="activarDesButton" data-toggle="tooltip" ToolTip='<%#(bool)Eval("active") ? "Desactivar" : "Activar e Enviar senha automatica para email."%>' CssClass="btn btn-default" runat="server" CommandArgument='<%#Eval("id") %>' OnCommand="alterarEstadoUser"><i class="fa fa-power-off"></i></asp:LinkButton>
                            <a href='Editar.aspx?id=<%#Eval("id") %>' data-toggle="tooltip" title="Editar" class="btn btn-default"><i class="fa fa-edit"></i></a>
                        </div>
                    </td>
                </tr>
            </ItemTemplate>
            <FooterTemplate>
                </tbody>
            </table>
            </div>
            </FooterTemplate>
        </asp:Repeater>
        <%} %>
    </div>




</asp:Content>
